Skip to content

πŸ”’ fix(security): remediate findings #740–#743 - #744

Merged
ryancheley merged 1 commit into
mainfrom
security-fixes-740-743
Jul 10, 2026
Merged

πŸ”’ fix(security): remediate findings #740–#743#744
ryancheley merged 1 commit into
mainfrom
security-fixes-740-743

Conversation

@ryancheley

Copy link
Copy Markdown
Owner

Remediates four security findings via the full Spec Kit workflow (artifacts in specs/003-security-fixes/). Threat model: single-user local install β€” remote/network threats in scope.

Closes #740. Closes #741. Closes #742. Closes #743.

Fixes

# Sev Fix
#740 Medium Path traversal β€” articles attach download sanitizes the server-supplied filename with Path(filename).name, confining writes to the working directory (falls back to attachment_<id> for empty/./..). Explicit --output (user's own path) is untouched.
#741 Medium Cleartext transport β€” warn_if_insecure_url() prints a stderr warning when a base URL uses http://, before the token is sent. Warn-only (still proceeds), per maintainer decision β€” keeps http://localhost/on-prem working.
#742 Low Shell hardening β€” tutorial executor now uses create_subprocess_exec with a parsed argv list instead of shell=True; shell metacharacters are inert. Removed the dead shell=True _execute_command in tutorial/core.py.
#743 Low Disclosure policy β€” added SECURITY.md.

Tests

tests/test_security_fixes.py β€” one regression test per behavioral fix (#740 traversal incl. absolute-path + normal-name cases; #741 http warns / https doesn't; #742 metacharacter payload creates no sentinel file). Removed obsolete tests for the deleted _execute_command. Full suite: 1399 passed.

Incidental (pre-existing, not security)

Kept minimal but needed to land a clean, non-bypassed pre-commit run after the local toolchain drifted:

  • Aligned the pre-commit ty hook with the tox type gate (same 0.0.1a14 pin + ignore list) so it stops flagging pre-existing warnings in unrelated files that the CI gate already ignores.
  • Fixed pre-existing pydocstyle nits on utils.loads_lenient's docstring (docstring-only, no behavior change).

Verification

CI merge gates all pass locally: ruff check/format, ty (a14), full pytest, package build, zizmor. No --no-verify.

πŸ€– Generated with Claude Code

- #740 path traversal: sanitize server-supplied attachment filename in
  `articles attach download` via Path(filename).name, confining writes to the
  working directory (falls back to attachment_<id> for empty/./.. names).
- #741 cleartext transport: warn on stderr when a base URL uses http:// before
  the token is sent (warn-only, still proceeds) via warn_if_insecure_url().
- #742 shell hardening: tutorial executor now uses create_subprocess_exec with
  a parsed argv list instead of shell=True; removed the dead shell=True
  _execute_command path in tutorial/core.py.
- #743: add SECURITY.md vulnerability disclosure policy.

Incidental (to keep local pre-commit == CI, both pre-existing, not security):
- align the pre-commit `ty` hook with the tox type gate (same 0.0.1a14 pin and
  ignore list) so it stops flagging unrelated warnings the CI gate ignores.
- fix pre-existing pydocstyle nits on utils.loads_lenient docstring.

Regression tests for #740/#741/#742 in tests/test_security_fixes.py; removed
obsolete tests for the deleted _execute_command. Threat model: single-user
local install. Built via Spec Kit; artifacts under specs/003-security-fixes/.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0166iS8CRLfRiyqCBaYtRDaR
@github-actions

Copy link
Copy Markdown

Profile summary:

GitHub user: ryancheley
🟒 No concerns found with user's profile.
🟒 No concerns found with recent PR activity.
🟒 No concerns found with recent issue activity.

For a more detailed report, run `gh-profiler ryancheley`.

@ryancheley
ryancheley merged commit 924583b into main Jul 10, 2026
14 checks passed
@ryancheley
ryancheley deleted the security-fixes-740-743 branch July 10, 2026 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment